# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui

from images import images_rc

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s

class UiMain(object):

    def __init__(self):
        """
            Construtor.
        """
        self.iconImage()



    def iconImage(self):
        """
            Carrega os icones dos botoes da tela principal.
        """
        self.pushButtonCalibracaoIcon = QtGui.QIcon(":/vna-icon/cal.png")
        self.pushButtonVnaIcon = QtGui.QIcon(":/vna-icon/vnaPlotter.png")
        self.pushButtonDbUpIcon = QtGui.QIcon(":/vna-icon/uploadDb.png")
        self.pushButtonAddDbIcon = QtGui.QIcon(":/vna-icon/addDb.png")
        self.pushButtonDbSearchIcon = QtGui.QIcon(":/vna-icon/searchDb.png")


    def setupUi(self, MainWindow):
        """
        
        """
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(570, 153)
        MainWindow.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)

        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))

        #Botao Calibracao.
        self.pushButtonCalibracao = QtGui.QPushButton(self.centralwidget)
        self.pushButtonCalibracao.setGeometry(QtCore.QRect(40, 44, 90, 61))
        self.pushButtonCalibracao.setObjectName(
                                                _fromUtf8(
                                                "pushButtonCalibracao"))
        self.pushButtonCalibracao.setIconSize(QtCore.QSize( 48, 48 ))
        self.pushButtonCalibracao.setIcon(
                                          QtGui.QIcon(
                                          self.pushButtonCalibracaoIcon))
        
        #Botao VNA
        self.pushButtonVna = QtGui.QPushButton(self.centralwidget)
        self.pushButtonVna.setGeometry(QtCore.QRect(140, 44, 90, 61))
        self.pushButtonVna.setObjectName(_fromUtf8("pushButtonVna"))
        self.pushButtonVna.setIconSize(QtCore.QSize(58, 52))
        self.pushButtonVna.setIcon(QtGui.QIcon(self.pushButtonVnaIcon))
        
        #Botao upload db
        self.pushButtonDbUp = QtGui.QPushButton(self.centralwidget)
        self.pushButtonDbUp.setGeometry(QtCore.QRect(240, 44, 90, 61))
        self.pushButtonDbUp.setObjectName(_fromUtf8("pushButtonDbUp"))
        self.pushButtonDbUp.setIconSize(QtCore.QSize(48, 48))
        self.pushButtonDbUp.setIcon(QtGui.QIcon(self.pushButtonDbUpIcon))
        
        #Botao adciciona no banco
        self.pushButtonAddDb = QtGui.QPushButton(self.centralwidget)
        self.pushButtonAddDb.setGeometry(QtCore.QRect(340, 44, 90, 61))
        self.pushButtonAddDb.setObjectName(_fromUtf8("pushButtonAddDb"))
        self.pushButtonAddDb.setIconSize(QtCore.QSize(48, 48 ))
        self.pushButtonAddDb.setIcon(QtGui.QIcon(self.pushButtonAddDbIcon))
        
        #Botao pesquisar banco
        self.pushButtonDbSearch = QtGui.QPushButton(self.centralwidget)
        self.pushButtonDbSearch.setGeometry(QtCore.QRect(440, 44, 90, 61))
        self.pushButtonDbSearch.setObjectName(_fromUtf8("pushButtonDbSearch"))
        self.pushButtonDbSearch.setIconSize(QtCore.QSize(48, 48))
        self.pushButtonDbSearch.setIcon(
                                        QtGui.QIcon(
                                        self.pushButtonDbSearchIcon))
        
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(170, 10, 210, 21))
        font = QtGui.QFont()
        font.setPointSize(16)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        
        self.line = QtGui.QFrame(self.centralwidget)
        self.line.setGeometry(QtCore.QRect(10, 30, 531, 16))
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        
        self.line_2 = QtGui.QFrame(self.centralwidget)
        self.line_2.setGeometry(QtCore.QRect(10, 100, 521, 16))
        self.line_2.setFrameShape(QtGui.QFrame.HLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_2.setObjectName(_fromUtf8("line_2"))
        
        MainWindow.setCentralWidget(self.centralwidget)

        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

        self.statusbar.setSizeGripEnabled( False )

        self.menubar = QtGui.QMenuBar( MainWindow )
        self.menubar.setGeometry( QtCore.QRect( 0, 0, 335, 21 ) )
        self.menubar.setObjectName( _fromUtf8( "menubar" ) )

        self.menuOpcoes = QtGui.QMenu( self.menubar )
        self.menuOpcoes.setObjectName( _fromUtf8( "menuOpcoes" ) )

        self.menuConfiguracoes = QtGui.QMenu( self.menubar )
        self.menuConfiguracoes.setObjectName( _fromUtf8( "menuConfiguracoes" ) )

        self.menuAjuda = QtGui.QMenu( self.menubar )
        self.menuAjuda.setObjectName( _fromUtf8( "menuAjuda" ) )

        MainWindow.setMenuBar( self.menubar )

        self.opcoesVna = QtGui.QMenu( self.menuOpcoes )
        self.opcoesVna.setObjectName( _fromUtf8( "opcoesVna" ) )
        
        self.actionResetVna = QtGui.QAction( MainWindow )
        self.actionResetVna.setObjectName( _fromUtf8( "actionResetVna" ) )

        self.opcoesDb = QtGui.QMenu( self.menuOpcoes )
        self.opcoesDb.setObjectName( _fromUtf8( "opcoesDb" ) )

        self.configuracoesVna = QtGui.QMenu( self.menuConfiguracoes )
        self.configuracoesVna.setObjectName( _fromUtf8( "configuracoesVna" ) )

        self.configuracoesDb = QtGui.QMenu( self.menuConfiguracoes )
        self.configuracoesDb.setObjectName( _fromUtf8( "configuracoesDb" ) )
        
        self.actionEscolhaVna = QtGui.QAction(  self.configuracoesVna )
        self.actionEscolhaVna.setObjectName( _fromUtf8( "actionEscolhaVna" ) )
        
        self.actionAddProduto = QtGui.QAction( self.configuracoesDb )
        self.actionAddProduto.setObjectName( _fromUtf8( "actionAddProduto" ) )
        
        self.actionEditarDb = QtGui.QAction( self.configuracoesDb )
        self.actionEditarDb.setObjectName( _fromUtf8( "actionEditarDb" ) )
        
        self.actionRecuperarDb = QtGui.QAction( self.configuracoesDb )
        self.actionRecuperarDb.setObjectName( _fromUtf8( "actionRecuperarDb" ) )
        
        self.actionAjuda = QtGui.QAction( MainWindow )
        self.actionAjuda.setObjectName( _fromUtf8( "actionAjuda" ) )

        self.actionSobre = QtGui.QAction( MainWindow )
        self.actionSobre.setObjectName( _fromUtf8( "actionSobre" ) )

        self.menuOpcoes.addSeparator()
        self.menuOpcoes.addMenu( self.opcoesVna )
        
        self.opcoesVna.addAction( self.actionResetVna )

        self.menuOpcoes.addMenu( self.opcoesDb )

        self.menuConfiguracoes.addSeparator()
        self.menuConfiguracoes.addMenu( self.configuracoesVna )
        self.menuConfiguracoes.addMenu( self.configuracoesDb )
        
        self.configuracoesVna.addAction( self.actionEscolhaVna )
        
        self.configuracoesDb.addAction( self.actionAddProduto )
        
        self.configuracoesDb.addAction( self.actionEditarDb )
        
        self.configuracoesDb.addAction( self.actionRecuperarDb )

        self.menuAjuda.addSeparator()
        self.menuAjuda.addAction( self.actionAjuda )
        self.menuAjuda.addAction( self.actionSobre )

        MainWindow.setStatusBar( self.statusbar )

        self.menubar.addAction( self.menuOpcoes.menuAction() )
        self.menubar.addAction( self.menuConfiguracoes.menuAction() )
        self.menubar.addAction( self.menuAjuda.menuAction() )

        self.retranslateUi( MainWindow )
        QtCore.QMetaObject.connectSlotsByName( MainWindow )



    def retranslateUi( self, MainWindow ):
        """
        
        """
        MainWindow.setWindowTitle(
                                  QtGui.QApplication.translate(
                                  "MainWindow", "TSM", None,
                                  QtGui.QApplication.UnicodeUTF8))
        self.label.setText(
                           QtGui.QApplication.translate(
                           "MainWindow", " TSM VNA PLOTTER", None,
                            QtGui.QApplication.UnicodeUTF8))
        self.menuOpcoes.setTitle(
                                 QtGui.QApplication.translate(
                                 "MainWindow", "Opções", None,
                                 QtGui.QApplication.UnicodeUTF8))
        self.menuConfiguracoes.setTitle(
                                        QtGui.QApplication.translate(
                                        "MainWindow", "Configurações", None,
                                        QtGui.QApplication.UnicodeUTF8))
        self.menuAjuda.setTitle(
                                QtGui.QApplication.translate(
                                "MainWindow", "Ajuda", None,
                                QtGui.QApplication.UnicodeUTF8))
        self.opcoesVna.setTitle(
                                QtGui.QApplication.translate(
                                "MainWindow", "Network", None,
                                QtGui.QApplication.UnicodeUTF8))
        self.opcoesDb.setTitle(
                               QtGui.QApplication.translate(
                               "MainWindow", "Banco de Dados", None,
                               QtGui.QApplication.UnicodeUTF8))
        self.configuracoesVna.setTitle(
                                       QtGui.QApplication.translate(
                                       "MainWindow", "Network", None,
                                       QtGui.QApplication.UnicodeUTF8))
        self.actionEscolhaVna.setText(
                                      QtGui.QApplication.translate(
                                      "MainWindow", "Modelo VNA", None,
                                      QtGui.QApplication.UnicodeUTF8))
        self.configuracoesDb.setTitle(
                                      QtGui.QApplication.translate(
                                      "MainWindow", "Banco de Dados", None,
                                      QtGui.QApplication.UnicodeUTF8))
        self.actionAjuda.setText(
                                 QtGui.QApplication.translate(
                                 "MainWindow", "Ajuda", None,
                                 QtGui.QApplication.UnicodeUTF8))
        self.actionSobre.setText(
                                 QtGui.QApplication.translate(
                                 "MainWindow", "Sobre", None,
                                 QtGui.QApplication.UnicodeUTF8))
        self.actionResetVna.setText(
                                    QtGui.QApplication.translate(
                                    "MainWindow", "Reset", None,
                                    QtGui.QApplication.UnicodeUTF8))
        self.actionAddProduto.setText(
                                      QtGui.QApplication.translate(
                                      "MainWindow", "Adicionar Produto", None,
                                      QtGui.QApplication.UnicodeUTF8))
        self.actionEditarDb.setText(
                                  QtGui.QApplication.translate(
                                  "MainWindow", "Editar Banco", None,
                                  QtGui.QApplication.UnicodeUTF8))
        self.actionRecuperarDb.setText(
                                       QtGui.QApplication.translate(
                                       "MainWindow", "Atualizar Banco", None,
                                       QtGui.QApplication.UnicodeUTF8))
        self.pushButtonCalibracao.setToolTip(
                                            QtGui.QApplication.translate(
                                            "MainWindow",
                                            "Calibracao", None,
                                            QtGui.QApplication.UnicodeUTF8))
        self.pushButtonVna.setToolTip(
                                      QtGui.QApplication.translate(
                                      "MainWindow",
                                      "VNA Plotter - Network", None,
                                      QtGui.QApplication.UnicodeUTF8))
        self.pushButtonDbUp.setToolTip(
                                       QtGui.QApplication.translate(
                                       "MainWindow",
                                       "Enviar Dados para o Banco",
                                       None,
                                       QtGui.QApplication.UnicodeUTF8))
        self.pushButtonDbSearch.setToolTip(
                                           QtGui.QApplication.translate(
                                           "MainWindow",
                                           "Pesquisar no Banco",
                                           None,
                                           QtGui.QApplication.UnicodeUTF8))
        self.pushButtonAddDb.setToolTip(
                                       QtGui.QApplication.translate(
                                       "MainWindow",
                                       "Adicionar no Banco",
                                       None,
                                       QtGui.QApplication.UnicodeUTF8))
